﻿using MyApp.IRepository;
using System.Data;
using MyApp.IService;

namespace MyApp.Service
{
    public class SqlService: ISqlService
    {
        ISqlRepository SqlRepository;
        public SqlService(ISqlRepository SqlRepository)
        {
            this.SqlRepository = SqlRepository;
        }
        /// <summary>
        /// 执行查询
        /// </summary>
        /// <param name="ConfigId"></param>
        /// <param name="sql"></param>
        /// <returns></returns>
        public DataTable GetDataTable(int configId, string sql)
        {
            return SqlRepository.GetDataTable(configId,sql);
        }
        /// <summary>
        /// 增删改
        /// </summary>
        /// <param name="ConfigId"></param>
        /// <param name="sql"></param>
        /// <returns></returns>
        public int ExecuteCommand(int configId, string sql)
        {
            return SqlRepository.ExecuteCommand(configId, sql);
        }
 
    }
}

